﻿#region using
using System;
using System.Collections.Generic;
using System.ServiceModel;
using System.ServiceModel.Activation;

using ibba.src.norisk.BusinessLogic;
using ibba.src.norisk.Contracts;

#endregion

/*****************************************************************************************************************          
 Copyright © 2010 - Banco Itaú BBA S.A          
          
 ContratoOperacao : 
            
 Histórico de Alterações:      
 09/06/2010 - Adriane M. Souza	- Criacao OS375720

 *****************************************************************************************************************/

namespace ibba.src.norisk.ServiceImplementation
{

    [AspNetCompatibilityRequirements(RequirementsMode = System.ServiceModel.Activation.AspNetCompatibilityRequirementsMode.Allowed)]
    [ServiceBehavior(InstanceContextMode = InstanceContextMode.PerSession,
                     ConcurrencyMode = ConcurrencyMode.Multiple)]

    class ContratoOperacao : IContratoOperacao
    {

        private ContratoOperacaoBL _contratoOperacaoBL;

        public ContratoOperacao()
        {

            try
            {
                _contratoOperacaoBL = new ContratoOperacaoBL();
            }
            catch (Exception ex)
            {
                global.ErrorHandler.LogAndThrowFaultException(ex);
            }

        }

        public List<ibba.src.norisk.Contracts.ContratoOperacao> ObterContratoOperacao(string pContrato)
        {
            List<ibba.src.norisk.Contracts.ContratoOperacao> retorno = null;

            try
            {

                retorno = TranslateContratoOperacao.Translate(_contratoOperacaoBL.ObterContratoOperacao(pContrato));
            }
            catch (Exception ex)
            {
                global.ErrorHandler.LogAndThrowFaultException(ex);
            }

            return (retorno);
        }


    }
}
